<?php
/**
 * The html template file of index method of blog module of ZenTaoPHP.
 *
 * The author disclaims copyright to this source code.  In place of
 * a legal notice, here is a blessing:
 * 
 *  May you do good and not evil.
 *  May you find forgiveness for yourself and forgive others.
 *  May you share freely, never taking more than you give.
 */
?>
<?php include '../../common/view/header.html.php';?>

<div id="sidebar">
<div class="accordion open">
<a href=""  class="accordion-toggle">系统配置<i class="slider_arrow"></i></a>
<div class="accordion-body">
<ul>
<li><?php echo html::a($this->createLink($menuModule,'userconf'), '用户管理');?></li>
<li class="active"><?php echo html::a($this->createLink($menuModule,'myinfo'), '我的信息');?></li>
</div>
</div>
</div>
<div id="main">
    <div class="main_title">系统管理<span class="level_divide">&gt; &gt;</span>我的信息</div>
    <div class="main_body info_password">
        <div class="content_block">
            <div class="content_block_title"></div>
            <div id="msg_container"></div>
            <div id="succ_tips" class="succ_tips" style="margin-left:5px;display:none;"></div>
            <div class="content_block_body" id="form_submit" style="padding-top:5px;">
                    <form action="" class="form" method="post" name="__form" id="submit_form">
                    <div class="control-group">
                        <label class="control-label" for="">用户名:</label>
                        <div class="controls">
                            <input type="text" name="username" id="username" readonly class="input1" value="<?php echo $_SESSION['username'];?>" style="width:300px;"  />
                        </div>
                    </div>
                    <div class="control-group">
                        <label class="control-label" for="">原密码:</label>
                        <div class="controls">
                           <input type="password" name="pwd_old" id="pwd_old" class="input1" value="" style="width:300px;" />
                        </div>
                    </div>

                   <div class="control-group">
                        <label class="control-label" for="">新密码:</label>
                        <div class="controls">
                           <input type="password" name="pwd_new" id="pwd_new"  class="input1" value="" style="width:300px;" />
                        </div>
                    </div>
                    
                    <div class="control-group" id="div_submit">
                        <label class="control-label" for=""></label>
                        <div class="controls">
                            <input type="button" class="btn btn-primary" id="btn_submit" value="修改密码" />
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<?php include '../../common/view/footer.html.php';?>
<script type="text/javascript">
  $(document).ready(function(e) {
	 $('#btn_submit').click(function(){
	    $.post("<?php echo $this->createLink('sysmanage','update_pwd')?>",$("#submit_form").serialize(),
		  function(data){
			  if(data=='success'){
				  tipInfo('修改成功');
				  $("#pwd_old").val('');
				  $("#pwd_new").val('');
			  }else if(data=='old_error'){
				 tipInfo('原密码错误'); 
			  }else{
				 tipInfo('修改失败'); 
			  }
		  });
	 })
	 
  });
</script>
